home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows the use of ExpandPath --->
- <HTML>
- <HEAD>
- <TITLE>
- ExpandPath Example
- </TITLE>
- </HEAD>
-
- <BODY bgcolor="#FFFFD5">
- <H3>ExpandPath Example</H3>
-
- This file has been disabled for online viewing. Please use your
- copy of ColdFusion to view this example.
- <!---
- <CFSET thisPath=ExpandPath("*.*")>
- <CFSET thisDirectory=GetDirectoryFromPath(thisPath)>
- <CFOUTPUT>
- The current directory is: #GetDirectoryFromPath(thisPath)#
-
- <CFIF IsDefined("form.yourFile")>
- <CFIF form.yourFile is not "">
- <CFSET yourFile = form.yourFile>
- <CFIF FileExists(ExpandPath(yourfile))>
- <P>Your file exists in this directory. You entered
- the correct file name, #GetFileFromPath("#thisPath#/#yourfile#")#
- <CFELSE>
- <P>Your file was not found in this directory:
- <BR>Here is a list of the other files in this directory:
- <!--- use CFDIRECTORY to give the contents of the
- snippets directory, order by name and size --->
- <CFDIRECTORY DIRECTORY="#thisDirectory#"
- NAME="myDirectory"
- SORT="name ASC, size DESC">
- <!--- Output the contents of the CFDIRECTORY as a CFTABLE --->
- <CFTABLE QUERY="myDirectory">
- <CFCOL HEADER="NAME:"
- TEXT="#Name#">
- <CFCOL HEADER="SIZE:"
- TEXT="#Size#">
- </CFTABLE>
- </CFIF>
- </CFIF>
- <CFELSE>
- <H3>Please enter a file name</H3>
- </CFIF>
- </CFOUTPUT>
-
- <FORM action="expandpath.cfm" METHOD="post">
- <H3>Enter the name of a file in this directory <I><FONT SIZE="-1">(try expandpath.cfm)</FONT></I></H3>
- <INPUT TYPE="Text" NAME="yourFile">
- <INPUT TYPE="Submit" NAME="">
- </FORM>
- --->
- </BODY>
- </HTML>
-